<?php
class Download extends AppModel {

	var $name = 'Download';
	var $validate = array(
		'summary' => VALID_NOT_EMPTY
	);
	
	/**
	 * Prepares file's data to save
	 *
	 * @param $data
	 * @param $SwfUpload
	 * @return prepared data
	 */
	function prepareFileData($data,&$SwfUpload) {
		$file = array();
		$file['Download']['file'] = $SwfUpload->filename;
		$file['Download']['size'] = $data['Download']['file']['size'];
		$file['Download']['type'] = $data['Download']['file']['type'];
		$file['Download']['summary'] = $data['Download']['summary'];
		$file['Download']['md5'] = md5($SwfUpload->filename);
		
		return $file;
	}
}
?>